package com.itheima.controller;


import com.itheima.domain.vo.PageBeanVo;
import com.itheima.domain.vo.QueryUserLocationVo;
import com.itheima.manager.UserLocationManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserLocationController {

    @Autowired
    private UserLocationManager userLocationManager;


    /*
     *
     *  实战后台-分页查询用户详细数据
     * @param page 分页数据
     * @param pageSize  分页数据
     * @author
     * @date
     * @return com.itheima.domain.vo.PageBeanVo
     */

    @GetMapping("/findUserList")
    public PageBeanVo userList(@RequestParam(defaultValue = "1") Integer page ,
                               @RequestParam(defaultValue = "10") Integer pageSize){

        return userLocationManager.findUserList(page,pageSize);
    }



    /*
     *  用户地理位置
     *
     * @param userId    用户Id
     * @author
     * @date
     * @return com.itheima.domain.vo.UserLocationVo
     */

    @GetMapping("/findUserMessages")
    public QueryUserLocationVo findUserLocation(Long userId){

        return userLocationManager.findUserLocation(userId);
    }
}
